{#**
 * 2007-2020 PrestaShop SA and Contributors
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2020 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}

{% extends '::base.html.twig' %}

{% block stylesheets %}
  <link rel="stylesheet" href="{{ asset('themes/new-theme/public/theme.css') }}" />
{% endblock %}

{% block title %}
  {{ 'Oops... looks like an unexpected error occurred'|trans({},'Admin.Notifications.Error' ) }}
{% endblock %}

{% block body %}
  <div class="container">
    <div class="row mt-5">
      <div class="col">
        <div class="card">
          <div class="card-body text-center">
            <img class="img-responsive"
                 src="{{ asset('themes/new-theme/img/error/500.svg') }}"
                 alt="{{ 'Oops... looks like an unexpected error occurred'|trans({}, 'Admin.Notifications.Error') }}"
            >

            <div class="mt-3">
              <p class="error-header">
                {{ 'Oops... looks like an unexpected error occurred'|trans({}, 'Admin.Notifications.Error') }}
              </p>

              {% if exception %}
                <div class="mx-auto">
                  <p class="mb-0">{{ exception.message }}</p>
                  <p class="mb-0">[{{ exception.class }} {{ exception.code }}]</p>
                </div>
              {% endif %}

              <div class="mt-4">
                <form action="{{ path('admin_errors_enable_debug_mode') }}" method="post" class="d-inline">
                  <input type="hidden" name="_redirect_url" value="{{ app.request.requestUri }}">

                  <button class="btn btn-outline-secondary" type="submit">
                    {{ 'Enable debug mode'|trans({}, 'Admin.Actions') }}
                  </button>
                </form>
                <button class="btn btn-primary js-go-back-btn ml-3" type="button">
                  {{ 'Back to previous page'|trans({}, 'Admin.Actions') }}
                </button>
              </div>

              <p class="mt-3">
                <a href="{{ documentation_link('debug_mode') }}" target="_blank">
                  {{ 'Learn more about debug mode'|trans({}, 'Admin.Actions') }}
                  <i class="material-icons">arrow_right_alt</i>
                </a>
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
{% endblock %}

{% block javascripts %}
  <script src="{{ asset('themes/new-theme/public/error.bundle.js') }}"></script>
{% endblock %}
